package com.serkol.utils;

import cn.hutool.core.date.DateUtil;

import java.util.Date;

public class DateUtils {

    public static String getYmdmdss(Date date) {
        String format = DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
        return format;
    }

    public static String getYmdmdss(Date date, int amount) {
        Date date1 = org.apache.commons.lang3.time.DateUtils.addDays(date, amount);

        String format = DateUtil.format(date1, "yyyy-MM-dd HH:mm:ss");
        return format;
    }
    public static Date getDay(Date date, int amount) {
        Date date1 = org.apache.commons.lang3.time.DateUtils.addDays(date,amount);

        return date1;
    }
    public static Date getMonth(Date date, int amount) {
        Date date1 = org.apache.commons.lang3.time.DateUtils.addMonths(date,amount);

        return date1;
    }
    public static Date getYear(Date date, int amount) {
        Date date1 = org.apache.commons.lang3.time.DateUtils.addYears(date,amount);

        return date1;
    }
  //  apply(“date_format(dateColumn,’%Y-%m-%d’) = ‘2008-08-08′”)—>date_format(dateColumn,’%Y-%m-%d’) = ‘2008-08-08′”)
}
